#coding:utf-8
import os
from Config import *
from xmlrpc.client import ServerProxy

class Comm:
    def __init__(self):
        url = "http://"
        self.server = ServerProxy(url + NODE_HOST + ":" + NODE_PORT + "/", allow_none=True)

    def send_info(self,msg):
        self.server.getInfo(msg)

    def send_log(self,process_name):
        if os.path.exists("/tmp/" + process_name + ".fuzz"):
            return None
        try:
            f = open("/tmp/" + process_name + ".fuzz", 'w')
            f.close()
        except:
            return False

        return True

